#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
#include "errsys.h"

void get_words(char *s){
	const int size = 1024;
	char buf[size];
	char *p=s;

	for(; *s; ++s){
		if( !isalnum(*s) ){
			if(isalnum(*p)){
			   strncpy(buf,p,s-p);
			   buf[s-p] = '\0';
			   printf("%s\n",buf);
			}
			p=s;
		}else{
			if(!isalnum(*p))
				p=s;
		}
	}
}

int main(int argc, char **argv)
{
	char buf[1024];

	for(;;)
	{
		if( fgets(buf,sizeof(buf),stdin) != NULL )
			get_words(buf);
		else
	                break;	
	}
	return 0;
}

